---
layout: default
---

{% assign tag = site.data.tags[page.tag] %}

<h1 class="page-title">{{tag.name}}</h1>
{% if tag.description %}
  {% comment %}
    Adding the "message" class to the last (and usually only) paragraph of the description.
  {% endcomment %}
  {% capture desc %}{{tag.description}}{:.message}{% endcapture %}
  {{desc | markdownify}}
{% endif %}

{% if site.tags[page.tag] %}
  {% for post in site.tags[page.tag] %}
    {% assign currentdate = post.date | date: "%Y" %}
    {% if currentdate != date %}
      {% unless forloop.first %}</ul>{% endunless %}
      <h2 id="y{{post.date | date: "%Y"}}">{{currentdate}}</h2>
      <ul class="related-posts">
      {% assign date = currentdate %}
    {% endif %}
    <li>
      <div class="heading">
        <a href="{{site.baseurl}}{{post.url}}"><span>{{post.title}}</span></a>
        <span class="timestamp">{{post.date | date: "%m/%d"}}</span>
      </div>
    </li>
    {% if forloop.last %}</ul>{% endif %}
  {% endfor %}
{% else %}
    <p>此标签下暂无文章</p>
{% endif %}
